package cn.ecut.services;

import cn.ecut.dao.UserDao;
import cn.ecut.model.User;

import java.sql.SQLException;
import java.util.List;
import java.util.Objects;

public class UserServices {
    private UserDao userDao = new UserDao();

    public User loadUsername(User user) throws SQLException {
        List<User> u = userDao.loadUsername(user);
        if (Objects.nonNull(u) && u.size()>0){
            return u.get(0);
        }
        return null;
    }
}
